Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4481 Print Individual Donation Receipts #4484

Merged
merged 5 commits into from
Jul 19, 2024

Conversation

mdphillips375
Copy link
Contributor

Resolves #4481

Description

Added buttons to donation list rows and donation view page to print PDF receipt of individual donation. PDF is modification of existing distribution receipt.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Added and modified sample donation records to provide a variety of types of donations: sources, various states of completeness of contact info, line items, money values.

For some reason rSpec is currently getting hung on my system, so these tests were not run. Only changes made to existing code was adding 2 routes, 2 buttons, and one controller method.

Screenshots

DonationShow
DonationRows
AllInfoPlusMoney
MfgOnlyItems
MiscNoItems
PartInfoNoItems

Hiding value columns:
Hide
Not hiding value columns:
NoHide

cielf
cielf previously requested changes Jun 29, 2024
Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well from a functional pov -- just one thing I'd like to see different functionally . Can we tweak it to include $0.00 for the Money raised if there wasn't any money raised? Why? Having a value there means it can't be as easily altered to show a false value.

I'd also like to see tests confirming that the print buttons show up

@mdphillips375
Copy link
Contributor Author

Added zero dollar money raised display and tests.

ZeroDollars

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a functional pov. Over to @dorner for technical input.

@cielf cielf dismissed their stale review July 2, 2024 17:28

addressed

@cielf cielf requested a review from dorner July 2, 2024 17:28
app/pdfs/donation_pdf.rb Outdated Show resolved Hide resolved
app/pdfs/donation_pdf.rb Outdated Show resolved Hide resolved
app/pdfs/donation_pdf.rb Show resolved Hide resolved
app/pdfs/donation_pdf.rb Outdated Show resolved Hide resolved
spec/pdfs/donation_pdf_spec.rb Show resolved Hide resolved
@mdphillips375
Copy link
Contributor Author

Latest changes pushed.

spec/pdfs/donation_pdf_spec.rb Show resolved Hide resolved
spec/pdfs/donation_pdf_spec.rb Show resolved Hide resolved
@mdphillips375
Copy link
Contributor Author

All things being tested for now have hardcoded values.

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have preferred hardcoding the things we were testing against as well (e.g. expect(pdf_test.page(1).text).to include('Site X'). But I'm not going to hold up the PR because of that.

@dorner dorner merged commit 4acb394 into rubyforgood:main Jul 19, 2024
19 checks passed
@dorner
Copy link
Collaborator

dorner commented Jul 19, 2024

Thanks very much!

Copy link
Contributor

@mdphillips375: Your PR 4481 Print Individual Donation Receipts is part of today's Human Essentials production release: 2024.07.21.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Print single donations
3 participants